<?php

namespace App\Http\Admin\Controllers;

use App\Http\Admin\Services\AdminService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;


class AdminController extends Controller
{
    private $service;
    public function __construct(AdminService $service)
    {
        $this->service = $service;
    }

    public function index()
    {
        return view('admin.user.index');
    }

    public function list(Request $request)
    {
        $res = $this->service->list();

        return res('账号列表',$res);
    }

    public function del(Request $request)
    {
        $ids = $request->input('ids',[]);

        $res = $this->service->del($ids);

        return res('删除成功',$res);
    }

    public function store(Request $request)
    {
        $attributes = $request->all();

        $res = $this->service->store($attributes);

        return res('提交成功',$res);
    }

}
